//
//  UIEnlargeButton.m
//  DPEduProject
//
//  Created by bianguangsheng on 2018/8/6.
//  Copyright © 2018年 bianguangsheng. All rights reserved.
//

#import "UIEnlargeButton.h"

@implementation UIEnlargeButton
- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event {
    CGRect bounds = self.bounds;
    //若热区小于44*44，则放大热区
    CGFloat widthDelta = MAX(44-bounds.size.width, 0);
    CGFloat heightDelta = MAX(44-bounds.size.height, 0);
    CGRect newBounds = CGRectInset(bounds, widthDelta*(-0.5), heightDelta*(-0.5));
    return CGRectContainsPoint(newBounds, point);
}

- (CGRect)imageRectForContentRect:(CGRect)contentRect {
    
    return CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height);
}









/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
